package metier;

import java.util.ArrayList;
import java.util.List;

import modele.Administrateur;
import modele.Emplacement;
import modele.Region;

import dao.AdministrateurDao;
import dao.RegionDao;

public class RegionMetier {

	public static boolean ajouterRegion(Region region) {

		RegionDao.ajouterRegion(region);
		return true;

	}

	public static Administrateur getAdministrateur(long idAdministrateur) {
		return AdministrateurDao.getAdministrateur(idAdministrateur);
	}

	public static boolean modifierRegion(Region region) {

		Region reg = RegionDao.getRegion(region.getIdentifiant());
		reg.setNom(region.getNom());
		reg.setDescription(region.getDescription());
		reg.setPopulation(region.getPopulation());
		RegionDao.modifierRegion(reg);
		return true;

	}
	
	public static List<Emplacement> getListeNomRegions(long idAdmin) {
		return RegionDao.getListeNomRegions(idAdmin);
	}

	public static void supprimerRegion(long idRegion) {
		Region region = RegionDao.getRegion(idRegion);
		RegionDao.supprimerRegion(region);
	}

	public static Region getRegion(long identifiant) {
		return RegionDao.getRegion(identifiant);
	}

	public static List<Region> getListeRegions(long idAdmin) {
		return RegionDao.getListeRegions(idAdmin);
	}

	public static ArrayList<Region> rechercherRegions(Region region) {
		return RegionDao.rechercherRegionsParCriteresParAdmin(region);
	}

}
